<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib  prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="redis" uri="http://www.shopjsp.com/redisTag/functions" %>
<c:set var="basePath" value="${redis:getSysConfig('base_path_back')}"/>
<c:set var="srcPath" value="${redis:getSysConfig('sysFileVisitRoot_back')}"/>
<c:set var="uploadPath" value="${redis:getSysConfig('uploadFileVisitRoot')}"/>
<script type="text/javascript">
    /**
     * 查看分类详情
     */
    function detailInfo(id){
        $.ajax({
            type: "POST",
            dataType: "JSON",
            url: "${basePath}/back/promotion/getPlatformPromotionObject.sjson",
            data: {promotionId:id},
            success: function(result){
                var data = JSON.parse(result.data);
                /**重置详情页中所有html展示信息**/
                resetDetailTable("detailTable");
                /**设置展示信息**/
                $("#d_largePoster").html("<img id='uploadImg_detail_1' class='uploadImg' onMouseOver='showDetailBigImage(1,3,3,0)'  onMouseOut='showDetailRebackImage(1,1,1)' src='${uploadPath}/"+data.largePoster+"' onerror='this.src=\"${srcPath}/common/images/mrbj.png\"' width='50px' height='50px' />");
                $("#d_smallPoster").html("<img id='uploadImg_detail_2' class='uploadImg' onMouseOver='showDetailBigImage(2,3,3,0)'  onMouseOut='showDetailRebackImage(2,1,1)' src='${uploadPath}/"+data.smallPoster+"' onerror='this.src=\"${srcPath}/common/images/mrbj.png\"' width='50px' height='50px' />");
                $("#d_promotionName").html(data.promotionName);
                $("#d_shopPromotionInfo").html(data.shopPromotionInfo);
                $("#d_promotionNumber").html(data.promotionNumber);

                if(data.beginTime!=""&&data.beginTime!=undefined){
                    $("#d_beginTime").html(new Date(data.beginTime).Format("yyyy-MM-dd hh:mm"));
                }

                if(data.endTime!=""&&data.endTime!=undefined){
                    $("#d_endTime").html(new Date(data.endTime).Format("yyyy-MM-dd hh:mm"));
                }

                if(data.useStatus==0){
                    $("#d_useStatus").html("<font class='color_003'>未开启</font>");
                }else if(data.useStatus==1){
                    $("#d_useStatus").html("<font class='color_001'>已开启</font>");
                }else if(data.useStatus==2){
                    $("#d_useStatus").html("<font class='color_002'>已结束</font>");
                }

                if(data.isPass==1){
                    $("#d_isPass").html("<font class='color_003'>待审核</font>");
                }else if(data.isPass==2){
                    $("#d_isPass").html("<font class='color_001'>审核通过</font>");
                }else if(data.isPass==3){
                    $("#d_isPass").html("<font class='color_002'>审核不通过</font>");
                }

                $("#d_verifier").empty().html(data.verifier);

                if(data.checkTime!=""&&data.checkTime!=undefined){
                    $("#d_checkTime").html(new Date(data.checkTime).Format("yyyy-MM-dd hh:mm:ss"));
                }

                if(data.createTime!=""&&data.createTime!=undefined){
                    $("#d_createTime").html(new Date(data.createTime).Format("yyyy-MM-dd hh:mm:ss"));
                }

                if(data.updateTime!=""&&data.updateTime!=undefined){
                    $("#d_updateTime").html(new Date(data.updateTime).Format("yyyy-MM-dd hh:mm:ss"));
                }

            }
        });
    }
</script>

<!--详情模态框（Modal） -->
<div class="modal fade" id="detailModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog" style="width:70%">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
				<h5 class="modal-title" id="myModalLabel">促销活动详情</h5>
			</div>
			<div class="modal-body">
				<table id="detailTable" align="center" class="addOrEditTable table table-bordered" style="width:100%;">
					<tr>
						<td class="toright_td" width="150px">活动大海报:</td>
						<td class="toleft_td" width="250px">&nbsp;&nbsp;<span id="d_largePoster"></span></td>
						<td class="toright_td" width="150px">活动小海报:</td>
						<td class="toleft_td" width="250px">&nbsp;&nbsp;<span id="d_smallPoster"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">活动主题:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_promotionName"></span></td>
						<td class="toright_td" width="150px">促销活动编号:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_promotionNumber"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">活动简介:</td>
						<td class="toleft_td" colspan="3">&nbsp;&nbsp;<span id="d_shopPromotionInfo"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">开始时间:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_beginTime"></span></td>
						<td class="toright_td" width="150px">结束时间:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_endTime"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">启用状态:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_useStatus"></span></td>
						<td class="toright_td" width="150px">审核状态:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_isPass"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">审核人:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_verifier"></span></td>
						<td class="toright_td" width="150px">审核时间:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_checkTime"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">创建时间:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_createTime"></span></td>
						<td class="toright_td" width="150px">修改时间:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_updateTime"></span></td>
					</tr>
				</table>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
			</div>
		</div><!-- /.modal-content -->
	</div><!-- /.modal -->
</div>